#!/usr/bin/env python
# encoding: utf-8
"""
foil_model.py

Created by Seth Nickell on 2008-10-17.
Copyright (c) 2008 __MyCompanyName__. All rights reserved.
"""

from simutils import *

import re

class FoilModel(object):
	def __init__(self, chord, span, fluid, angle, density):
		pass

class CoefficientTable(object):
	def __init__(self, table):
		whitespace = re.compile(r' +')
		lines = [[float(y) for y in whitespace.split(x.strip())] for x in table.split("<BR>\n") if x != '']
		self.alphaDict = dict([(x[0],x[1:]) for x in lines[1:]])
		self.alphaDict[360] = self.alphaDict[0]
		self.reynoldsNumbers = [int(x) for x in lines[0]]

	def get_reynolds_values(self, alpha):
		if self.alphaDict.has_key(alpha):
			return self.alphaDict[alpha]
		
		# Now we find the lower value
		if self.alphaDict.has_key(int(alpha)):
			lower_alpha = int(alpha)
		else:
			lower_alpha = int(alpha - alpha % 5)
		
		# Now we find the upper value
		if self.alphaDict.has_key(int(math.ceil(alpha))):
			upper_alpha = int(math.ceil(alpha))
		else:
			upper_alpha = int(5.000000001 + alpha - alpha % 5)
			
		# print "Lower is %d, Upper is %d" % (lower_alpha, upper_alpha)
		lower_reynolds = self.alphaDict[lower_alpha]
		upper_reynolds = self.alphaDict[upper_alpha]
		
		distance = float(alpha - lower_alpha) / float(upper_alpha - lower_alpha)
		interpolate = lambda lower, upper, distance: lower + (upper - lower) * distance
		
		middles = []
		for i in range(len(lower_reynolds)):
			lower = lower_reynolds[i]
			upper = upper_reynolds[i]
			m_value = interpolate(lower, upper, distance)
			middles.append(m_value)
		return middles
		
		
	def get_coefficient(self, alpha, target_reynolds):
		alpha = degrees(alpha)
		if alpha < 0: alpha += 180.0		
		reynolds_values = self.get_reynolds_values(alpha)

		if   target_reynolds < self.reynoldsNumbers[0]: 
			print "WARNING: asking for a reynolds (%d) below our table values" % (int(target_reynolds))
			return reynolds_values[0]
		elif target_reynolds > self.reynoldsNumbers[-1]: 
			print "WARNING: asking for a reynolds (%d) above our table values" % (int(target_reynolds))
			return reynolds_values[-1]
		elif target_reynolds in self.reynoldsNumbers: return reynolds_values[self.reynoldsNumbers.index(target_reynolds)]
		else:
			found = False
			for i in range(1,len(self.reynoldsNumbers)):
				if self.reynoldsNumbers[i-1] <= target_reynolds <= self.reynoldsNumbers[i]:
					lower_index = i-1
					upper_index = i
					found = True
					break
			
			if not found: raise Exception("Oops, how did we not find target %d in %s?" % (target_reynolds, str(self.reynoldsNumbers)))
						
			distance = float(target_reynolds - self.reynoldsNumbers[lower_index]) / float(self.reynoldsNumbers[upper_index] - self.reynoldsNumbers[lower_index])
			interpolate = lambda lower, upper, distance: lower + (upper - lower) * distance
			return interpolate(reynolds_values[lower_index], reynolds_values[upper_index], distance)
		
cd_string = """   80000   160000  360000  700000  1000000 2000000 5000000 10000000 <BR>
0       0.0147  0.0116  0.0091  0.0077  0.0074  0.0070  0.0068  0.0068   <BR>
1       0.0148  0.0117  0.0092  0.0078  0.0075  0.0071  0.0069  0.0068   <BR>
2       0.0151  0.0120  0.0094  0.0080  0.0076  0.0072  0.0070  0.0069   <BR>
3       0.0156  0.0124  0.0098  0.0083  0.0079  0.0075  0.0073  0.0071   <BR>
4       0.0168  0.0132  0.0105  0.0089  0.0083  0.0078  0.0075  0.0074   <BR>
5       0.0181  0.0142  0.0114  0.0098  0.0091  0.0083  0.0080  0.0077   <BR>
6       0.0197  0.0160  0.0126  0.0108  0.0101  0.0090  0.0084  0.0081   <BR>
7       0.0214  0.0176  0.0143  0.0122  0.0111  0.0098  0.0089  0.0086   <BR>
8       0.0234  0.0193  0.0157  0.0135  0.0126  0.0108  0.0095  0.0090   <BR>
9       0.0255  0.0212  0.0173  0.0149  0.0138  0.0121  0.0102  0.0096   <BR>
10      0.0277  0.0233  0.0191  0.0164  0.0152  0.0133  0.0113  0.0103   <BR>
11      0.0760  0.0256  0.0211  0.0182  0.0168  0.0146  0.0124  0.0114   <BR>
12      0.1230  0.0281  0.0233  0.0200  0.0186  0.0161  0.0136  0.0123   <BR>
13      0.1400  0.0302  0.0257  0.0221  0.0205  0.0177  0.0149  0.0134   <BR>
14      0.1580  0.1040  0.0283  0.0244  0.0225  0.0195  0.0164  0.0147   <BR>
15      0.1770  0.1770  0.0312  0.0269  0.0249  0.0215  0.0180  0.0161   <BR>
16      0.1960  0.1970  0.1240  0.0297  0.0275  0.0237  0.0198  0.0176   <BR>
17      0.2170  0.2170  0.2170  0.1340  0.0303  0.0261  0.0218  0.0194   <BR>
18      0.2380  0.2380  0.2380  0.2380  0.1450  0.0288  0.0240  0.0213   <BR>
19      0.2600  0.2600  0.2600  0.2600  0.2600  0.1550  0.0265  0.0234   <BR>
20      0.2820  0.2820  0.2820  0.2820  0.2820  0.2820  0.1660  0.0257   <BR>
21      0.3050  0.3050  0.3050  0.3050  0.3050  0.3050  0.3050  0.1770   <BR>
22      0.3290  0.3290  0.3290  0.3290  0.3290  0.3290  0.3290  0.3290   <BR>
23      0.3540  0.3540  0.3540  0.3540  0.3540  0.3540  0.3540  0.3540   <BR>
24      0.3790  0.3790  0.3790  0.3790  0.3790  0.3790  0.3790  0.3790   <BR>
25      0.4050  0.4050  0.4050  0.4050  0.4050  0.4050  0.4050  0.4050   <BR>
26      0.4320  0.4320  0.4320  0.4320  0.4320  0.4320  0.4320  0.4320   <BR>
27      0.4600  0.4600  0.4600  0.4600  0.4600  0.4600  0.4600  0.4600   <BR>
30      0.5700  0.5700  0.5700  0.5700  0.5700  0.5700  0.5700  0.5700   <BR>
35      0.7450  0.7450  0.7450  0.7450  0.7450  0.7450  0.7450  0.7450   <BR>
40      0.9200  0.9200  0.9200  0.9200  0.9200  0.9200  0.9200  0.9200   <BR>
45      1.0750  1.0750  1.0750  1.0750  1.0750  1.0750  1.0750  1.0750   <BR>
50      1.2150  1.2150  1.2150  1.2150  1.2150  1.2150  1.2150  1.2150   <BR>
55      1.3450  1.3450  1.3450  1.3450  1.3450  1.3450  1.3450  1.3450   <BR>
60      1.4700  1.4700  1.4700  1.4700  1.4700  1.4700  1.4700  1.4700   <BR>
65      1.5750  1.5750  1.5750  1.5750  1.5750  1.5750  1.5750  1.5750   <BR>
70      1.6650  1.6650  1.6650  1.6650  1.6650  1.6650  1.6650  1.6650   <BR>
75      1.7350  1.7350  1.7350  1.7350  1.7350  1.7350  1.7350  1.7350   <BR>
80      1.7800  1.7800  1.7800  1.7800  1.7800  1.7800  1.7800  1.7800   <BR>
85      1.8000  1.8000  1.8000  1.8000  1.8000  1.8000  1.8000  1.8000   <BR>
90      1.8000  1.8000  1.8000  1.8000  1.8000  1.8000  1.8000  1.8000   <BR>
95      1.7800  1.7800  1.7800  1.7800  1.7800  1.7800  1.7800  1.7800   <BR>
100     1.7500  1.7500  1.7500  1.7500  1.7500  1.7500  1.7500  1.7500   <BR>
105     1.7000  1.7000  1.7000  1.7000  1.7000  1.7000  1.7000  1.7000   <BR>
110     1.6350  1.6350  1.6350  1.6350  1.6350  1.6350  1.6350  1.6350   <BR>
115     1.5550  1.5550  1.5550  1.5550  1.5550  1.5550  1.5550  1.5550   <BR>
120     1.4650  1.4650  1.4650  1.4650  1.4650  1.4650  1.4650  1.4650   <BR>
125     1.3500  1.3500  1.3500  1.3500  1.3500  1.3500  1.3500  1.3500   <BR>
130     1.2250  1.2250  1.2250  1.2250  1.2250  1.2250  1.2250  1.2250   <BR>
135     1.0850  1.0850  1.0850  1.0850  1.0850  1.0850  1.0850  1.0850   <BR>
140     0.9250  0.9250  0.9250  0.9250  0.9250  0.9250  0.9250  0.9250   <BR>
145     0.7550  0.7550  0.7550  0.7550  0.7550  0.7550  0.7550  0.7550   <BR>
150     0.5750  0.5750  0.5750  0.5750  0.5750  0.5750  0.5750  0.5750   <BR>
155     0.4200  0.4200  0.4200  0.4200  0.4200  0.4200  0.4200  0.4200   <BR>
160     0.3200  0.3200  0.3200  0.3200  0.3200  0.3200  0.3200  0.3200   <BR>
165     0.2300  0.2300  0.2300  0.2300  0.2300  0.2300  0.2300  0.2300   <BR>
170     0.1400  0.1400  0.1400  0.1400  0.1400  0.1400  0.1400  0.1400   <BR>
175     0.0550  0.0550  0.0550  0.0550  0.0550  0.0550  0.0550  0.0550   <BR>
180     0.0250  0.0250  0.0250  0.0250  0.0250  0.0250  0.0250  0.0250   <BR>
185     0.0550  0.0550  0.0550  0.0550  0.0550  0.0550  0.0550  0.0550   <BR>
190     0.1400  0.1400  0.1400  0.1400  0.1400  0.1400  0.1400  0.1400   <BR>
195     0.2300  0.2300  0.2300  0.2300  0.2300  0.2300  0.2300  0.2300   <BR>
200     0.3200  0.3200  0.3200  0.3200  0.3200  0.3200  0.3200  0.3200   <BR>
205     0.4200  0.4200  0.4200  0.4200  0.4200  0.4200  0.4200  0.4200   <BR>
210     0.5750  0.5750  0.5750  0.5750  0.5750  0.5750  0.5750  0.5750   <BR>
215     0.7550  0.7550  0.7550  0.7550  0.7550  0.7550  0.7550  0.7550   <BR>
220     0.9250  0.9250  0.9250  0.9250  0.9250  0.9250  0.9250  0.9250   <BR>
225     1.0850  1.0850  1.0850  1.0850  1.0850  1.0850  1.0850  1.0850   <BR>
230     1.2250  1.2250  1.2250  1.2250  1.2250  1.2250  1.2250  1.2250   <BR>
235     1.3500  1.3500  1.3500  1.3500  1.3500  1.3500  1.3500  1.3500   <BR>
240     1.4650  1.4650  1.4650  1.4650  1.4650  1.4650  1.4650  1.4650   <BR>
245     1.5550  1.5550  1.5550  1.5550  1.5550  1.5550  1.5550  1.5550   <BR>
250     1.6350  1.6350  1.6350  1.6350  1.6350  1.6350  1.6350  1.6350   <BR>
255     1.7000  1.7000  1.7000  1.7000  1.7000  1.7000  1.7000  1.7000   <BR>
260     1.7500  1.7500  1.7500  1.7500  1.7500  1.7500  1.7500  1.7500   <BR>
265     1.7800  1.7800  1.7800  1.7800  1.7800  1.7800  1.7800  1.7800   <BR>
270     1.8000  1.8000  1.8000  1.8000  1.8000  1.8000  1.8000  1.8000   <BR>
275     1.8000  1.8000  1.8000  1.8000  1.8000  1.8000  1.8000  1.8000   <BR>
280     1.7800  1.7800  1.7800  1.7800  1.7800  1.7800  1.7800  1.7800   <BR>
285     1.7350  1.7350  1.7350  1.7350  1.7350  1.7350  1.7350  1.7350   <BR>
290     1.6650  1.6650  1.6650  1.6650  1.6650  1.6650  1.6650  1.6650   <BR>
295     1.5750  1.5750  1.5750  1.5750  1.5750  1.5750  1.5750  1.5750   <BR>
300     1.4700  1.4700  1.4700  1.4700  1.4700  1.4700  1.4700  1.4700   <BR>
305     1.3450  1.3450  1.3450  1.3450  1.3450  1.3450  1.3450  1.3450   <BR>
310     1.2150  1.2150  1.2150  1.2150  1.2150  1.2150  1.2150  1.2150   <BR>
315     1.0750  1.0750  1.0750  1.0750  1.0750  1.0750  1.0750  1.0750   <BR>
320     0.9200  0.9200  0.9200  0.9200  0.9200  0.9200  0.9200  0.9200   <BR>
325     0.7450  0.7450  0.7450  0.7450  0.7450  0.7450  0.7450  0.7450   <BR>
330     0.5700  0.5700  0.5700  0.5700  0.5700  0.5700  0.5700  0.5700   <BR>
333     0.4600  0.4600  0.4600  0.4600  0.4600  0.4600  0.4600  0.4600   <BR>
334     0.4320  0.4320  0.4320  0.4320  0.4320  0.4320  0.4320  0.4320   <BR>
335     0.4050  0.4050  0.4050  0.4050  0.4050  0.4050  0.4050  0.4050   <BR>
336     0.3790  0.3790  0.3790  0.3790  0.3790  0.3790  0.3790  0.3790   <BR>
337     0.3540  0.3540  0.3540  0.3540  0.3540  0.3540  0.3540  0.3540   <BR>
338     0.3290  0.3290  0.3290  0.3290  0.3290  0.3290  0.3290  0.3290   <BR>
339     0.3050  0.3050  0.3050  0.3050  0.3050  0.3050  0.3050  0.1770   <BR>
340     0.2820  0.2820  0.2820  0.2820  0.2820  0.2820  0.1660  0.0257   <BR>
341     0.2600  0.2600  0.2600  0.2600  0.2600  0.1550  0.0265  0.0234   <BR>
342     0.2380  0.2380  0.2380  0.2380  0.1450  0.0288  0.0240  0.0213   <BR>
343     0.2170  0.2170  0.2170  0.1340  0.0303  0.0261  0.0218  0.0194   <BR>
344     0.1960  0.1970  0.1240  0.0297  0.0275  0.0237  0.0198  0.0176   <BR>
345     0.1770  0.1770  0.0312  0.0269  0.0249  0.0215  0.0180  0.0161   <BR>
346     0.1580  0.1040  0.0283  0.0244  0.0225  0.0195  0.0164  0.0147   <BR>
347     0.1400  0.0302  0.0257  0.0221  0.0205  0.0177  0.0149  0.0134   <BR>
348     0.1230  0.0281  0.0233  0.0200  0.0186  0.0161  0.0136  0.0123   <BR>
349     0.0760  0.0256  0.0211  0.0182  0.0168  0.0146  0.0124  0.0114   <BR>
350     0.0277  0.0233  0.0191  0.0164  0.0152  0.0133  0.0113  0.0103   <BR>
351     0.0255  0.0212  0.0173  0.0149  0.0138  0.0121  0.0102  0.0096   <BR>
352     0.0234  0.0193  0.0157  0.0135  0.0126  0.0108  0.0095  0.0090   <BR>
353     0.0214  0.0176  0.0143  0.0122  0.0111  0.0098  0.0089  0.0086   <BR>
354     0.0197  0.0160  0.0126  0.0108  0.0101  0.0090  0.0084  0.0081   <BR>
355     0.0181  0.0142  0.0114  0.0098  0.0091  0.0083  0.0080  0.0077   <BR>
356     0.0168  0.0132  0.0105  0.0089  0.0083  0.0078  0.0075  0.0074   <BR>
357     0.0156  0.0124  0.0098  0.0083  0.0079  0.0075  0.0073  0.0071   <BR>
358     0.0151  0.0120  0.0094  0.0080  0.0076  0.0072  0.0070  0.0069   <BR>
359     0.0148  0.0117  0.0092  0.0078  0.0075  0.0071  0.0069  0.0068   <BR>
"""

cl_string = """   80000   160000  360000  700000  1000000 2000000 5000000 10000000 <BR>
0       0.0000  0.0000  0.0000  0.0000  0.0000  0.0000  0.0000  0.0000   <BR>
1       0.1100  0.1100  0.1100  0.1100  0.1100  0.1100  0.1100  0.1100   <BR>
2       0.2200  0.2200  0.2200  0.2200  0.2200  0.2200  0.2200  0.2200   <BR>
3       0.3300  0.3300  0.3300  0.3300  0.3300  0.3300  0.3300  0.3300   <BR>
4       0.4186  0.4400  0.4400  0.4400  0.4400  0.4400  0.4400  0.4400   <BR>
5       0.5180  0.5500  0.5500  0.5500  0.5500  0.5500  0.5500  0.5500   <BR>
6       0.6048  0.6299  0.6600  0.6600  0.6600  0.6600  0.6600  0.6600   <BR>
7       0.6760  0.7150  0.7390  0.7483  0.7700  0.7700  0.7700  0.7700   <BR>
8       0.7189  0.7851  0.8240  0.8442  0.8504  0.8800  0.8800  0.8800   <BR>
9       0.6969  0.8311  0.8946  0.9260  0.9387  0.9574  0.9900  0.9900   <BR>
10      0.6122  0.8322  0.9440  0.9937  1.0141  1.0433  1.0685  1.1000   <BR>
11      0.1642  0.7623  0.9572  1.0363  1.0686  1.1138  1.1553  1.1749   <BR>
12      0.0749  0.5936  0.9285  1.0508  1.0971  1.1667  1.2290  1.2591   <BR>
13      0.0967  0.3548  0.8562  1.0302  1.0957  1.1948  1.2847  1.3300   <BR>
14      0.1382  0.2371  0.7483  0.9801  1.0656  1.1962  1.3187  1.3825   <BR>
15      0.1861  0.2376  0.6350  0.9119  1.0145  1.1744  1.3298  1.4136   <BR>
16      0.2364  0.2665  0.5384  0.8401  0.9567  1.1356  1.3186  1.4233   <BR>
17      0.2873  0.3098  0.4851  0.7799  0.8996  1.0921  1.2917  1.4136   <BR>
18      0.3393  0.3567  0.4782  0.7305  0.8566  1.0510  1.2576  1.3897   <BR>
19      0.3927  0.4066  0.4908  0.7041  0.8226  1.0173  1.2242  1.3608   <BR>
20      0.4463  0.4575  0.5247  0.6990  0.8089  0.9954  1.1965  1.3325   <BR>
21      0.5001  0.5087  0.5616  0.7097  0.8063  0.9837  1.1771  1.3077   <BR>
22      0.5539  0.5611  0.6045  0.7298  0.8189  0.9827  1.1647  1.2767   <BR>
23      0.6078  0.6148  0.6528  0.7593  0.8408  0.9910  1.1611  1.1981   <BR>
24      0.6617  0.6685  0.7015  0.7961  0.8668  1.0078  1.1563  1.1538   <BR>
25      0.7156  0.7224  0.7511  0.8353  0.9023  1.0317  1.1322  1.1380   <BR>
26      0.7700  0.7771  0.8055  0.8838  0.9406  1.0591  1.1268  1.1374   <BR>
27      0.8277  0.8382  0.8788  0.9473  0.9912  1.0810  1.1397  1.1519   <BR>
30      0.8550  0.8550  0.9300  0.9600  1.0100  1.0700  1.1000  1.1200   <BR>
35      0.9800  0.9800  0.9820  0.9800  1.0200  1.0620  1.0800  1.1000   <BR>
40      1.0350  1.0350  1.0350  1.0350  1.0350  1.0550  1.0600  1.0700   <BR>
45      1.0500  1.0500  1.0500  1.0500  1.0500  1.0500  1.0500  1.0500   <BR>
50      1.0200  1.0200  1.0200  1.0200  1.0200  1.0200  1.0200  1.0200   <BR>
55      0.9550  0.9550  0.9550  0.9550  0.9550  0.9550  0.9550  0.9550   <BR>
60      0.8750  0.8750  0.8750  0.8750  0.8750  0.8750  0.8750  0.8750   <BR>
65      0.7600  0.7600  0.7600  0.7600  0.7600  0.7600  0.7600  0.7600   <BR>
70      0.6300  0.6300  0.6300  0.6300  0.6300  0.6300  0.6300  0.6300   <BR>
75      0.5000  0.5000  0.5000  0.5000  0.5000  0.5000  0.5000  0.5000   <BR>
80      0.3650  0.3650  0.3650  0.3650  0.3650  0.3650  0.3650  0.3650   <BR>
85      0.2300  0.2300  0.2300  0.2300  0.2300  0.2300  0.2300  0.2300   <BR>
90      0.0900  0.0900  0.0900  0.0900  0.0900  0.0900  0.0900  0.0900   <BR>
95      -0.0500 -0.0500 -0.0500 -0.0500 -0.0500 -0.0500 -0.0500 -0.0500  <BR>
100     -0.1850 -0.1850 -0.1850 -0.1850 -0.1850 -0.1850 -0.1850 -0.1850  <BR>
105     -0.3200 -0.3200 -0.3200 -0.3200 -0.3200 -0.3200 -0.3200 -0.3200  <BR>
110     -0.4500 -0.4500 -0.4500 -0.4500 -0.4500 -0.4500 -0.4500 -0.4500  <BR>
115     -0.5750 -0.5750 -0.5750 -0.5750 -0.5750 -0.5750 -0.5750 -0.5750  <BR>
120     -0.6700 -0.6700 -0.6700 -0.6700 -0.6700 -0.6700 -0.6700 -0.6700  <BR>
125     -0.7600 -0.7600 -0.7600 -0.7600 -0.7600 -0.7600 -0.7600 -0.7600  <BR>
130     -0.8500 -0.8500 -0.8500 -0.8500 -0.8500 -0.8500 -0.8500 -0.8500  <BR>
135     -0.9300 -0.9300 -0.9300 -0.9300 -0.9300 -0.9300 -0.9300 -0.9300  <BR>
140     -0.9800 -0.9800 -0.9800 -0.9800 -0.9800 -0.9800 -0.9800 -0.9800  <BR>
145     -0.9000 -0.9000 -0.9000 -0.9000 -0.9000 -0.9000 -0.9000 -0.9000  <BR>
150     -0.7700 -0.7700 -0.7700 -0.7700 -0.7700 -0.7700 -0.7700 -0.7700  <BR>
155     -0.6700 -0.6700 -0.6700 -0.6700 -0.6700 -0.6700 -0.6700 -0.6700  <BR>
160     -0.6350 -0.6350 -0.6350 -0.6350 -0.6350 -0.6350 -0.6350 -0.6350  <BR>
165     -0.6800 -0.6800 -0.6800 -0.6800 -0.6800 -0.6800 -0.6800 -0.6800  <BR>
170     -0.8500 -0.8500 -0.8500 -0.8500 -0.8500 -0.8500 -0.8500 -0.8500  <BR>
175     -0.6600 -0.6600 -0.6600 -0.6600 -0.6600 -0.6600 -0.6600 -0.6600  <BR>
180     0.0000  0.0000  0.0000  0.0000  0.0000  0.0000  0.0000  0.0000   <BR>
185     0.6600  0.6600  0.6600  0.6600  0.6600  0.6600  0.6600  0.6600   <BR>
190     0.8500  0.8500  0.8500  0.8500  0.8500  0.8500  0.8500  0.8500   <BR>
195     0.6800  0.6800  0.6800  0.6800  0.6800  0.6800  0.6800  0.6800   <BR>
200     0.6350  0.6350  0.6350  0.6350  0.6350  0.6350  0.6350  0.6350   <BR>
205     0.6700  0.6700  0.6700  0.6700  0.6700  0.6700  0.6700  0.6700   <BR>
210     0.7700  0.7700  0.7700  0.7700  0.7700  0.7700  0.7700  0.7700   <BR>
215     0.9000  0.9000  0.9000  0.9000  0.9000  0.9000  0.9000  0.9000   <BR>
220     0.9800  0.9800  0.9800  0.9800  0.9800  0.9800  0.9800  0.9800   <BR>
225     0.9300  0.9300  0.9300  0.9300  0.9300  0.9300  0.9300  0.9300   <BR>
230     0.8500  0.8500  0.8500  0.8500  0.8500  0.8500  0.8500  0.8500   <BR>
235     0.7600  0.7600  0.7600  0.7600  0.7600  0.7600  0.7600  0.7600   <BR>
240     0.6700  0.6700  0.6700  0.6700  0.6700  0.6700  0.6700  0.6700   <BR>
245     0.5750  0.5750  0.5750  0.5750  0.5750  0.5750  0.5750  0.5750   <BR>
250     0.4500  0.4500  0.4500  0.4500  0.4500  0.4500  0.4500  0.4500   <BR>
255     0.3200  0.3200  0.3200  0.3200  0.3200  0.3200  0.3200  0.3200   <BR>
260     0.1850  0.1850  0.1850  0.1850  0.1850  0.1850  0.1850  0.1850   <BR>
265     0.0500  0.0500  0.0500  0.0500  0.0500  0.0500  0.0500  0.0500   <BR>
270     -0.0900 -0.0900 -0.0900 -0.0900 -0.0900 -0.0900 -0.0900 -0.0900  <BR>
275     -0.2300 -0.2300 -0.2300 -0.2300 -0.2300 -0.2300 -0.2300 -0.2300  <BR>
280     -0.3650 -0.3650 -0.3650 -0.3650 -0.3650 -0.3650 -0.3650 -0.3650  <BR>
285     -0.5000 -0.5000 -0.5000 -0.5000 -0.5000 -0.5000 -0.5000 -0.5000  <BR>
290     -0.6300 -0.6300 -0.6300 -0.6300 -0.6300 -0.6300 -0.6300 -0.6300  <BR>
295     -0.7600 -0.7600 -0.7600 -0.7600 -0.7600 -0.7600 -0.7600 -0.7600  <BR>
300     -0.8750 -0.8750 -0.8750 -0.8750 -0.8750 -0.8750 -0.8750 -0.8750  <BR>
305     -0.9550 -0.9550 -0.9550 -0.9550 -0.9550 -0.9550 -0.9550 -0.9550  <BR>
310     -1.0200 -1.0200 -1.0200 -1.0200 -1.0200 -1.0200 -1.0200 -1.0200  <BR>
315     -1.0500 -1.0500 -1.0500 -1.0500 -1.0500 -1.0500 -1.0500 -1.0500  <BR>
320     -1.0350 -1.0350 -1.0350 -1.0350 -1.0350 -1.0550 -1.0600 -1.0700  <BR>
325     -0.9800 -0.9800 -0.9820 -0.9800 -1.0200 -1.0620 -1.0800 -1.1000  <BR>
330     -0.8550 -0.8550 -0.9300 -0.9600 -1.0100 -1.0700 -1.1000 -1.1200  <BR>
333     -0.8277 -0.8382 -0.8788 -0.9473 -0.9912 -1.0810 -1.1397 -1.1519  <BR>
334     -0.7700 -0.7771 -0.8055 -0.8838 -0.9406 -1.0591 -1.1268 -1.1374  <BR>
335     -0.7156 -0.7224 -0.7511 -0.8353 -0.9023 -1.0317 -1.1322 -1.1380  <BR>
336     -0.6617 -0.6685 -0.7015 -0.7961 -0.8668 -1.0078 -1.1563 -1.1538  <BR>
337     -0.6078 -0.6148 -0.6528 -0.7593 -0.8408 -0.9910 -1.1611 -1.1981  <BR>
338     -0.5539 -0.5611 -0.6045 -0.7298 -0.8189 -0.9827 -1.1647 -1.2767  <BR>
339     -0.5001 -0.5087 -0.5616 -0.7097 -0.8063 -0.9837 -1.1771 -1.3077  <BR>
340     -0.4463 -0.4575 -0.5247 -0.6990 -0.8089 -0.9954 -1.1965 -1.3325  <BR>
341     -0.3927 -0.4066 -0.4908 -0.7041 -0.8226 -1.0173 -1.2242 -1.3608  <BR>
342     -0.3393 -0.3567 -0.4782 -0.7305 -0.8566 -1.0510 -1.2576 -1.3897  <BR>
343     -0.2873 -0.3098 -0.4851 -0.7799 -0.8996 -1.0921 -1.2917 -1.4136  <BR>
344     -0.2364 -0.2665 -0.5384 -0.8401 -0.9567 -1.1356 -1.3186 -1.4233  <BR>
345     -0.1861 -0.2376 -0.6350 -0.9119 -1.0145 -1.1744 -1.3298 -1.4136  <BR>
346     -0.1382 -0.2371 -0.7483 -0.9801 -1.0656 -1.1962 -1.3187 -1.3825  <BR>
347     -0.0967 -0.3548 -0.8562 -1.0302 -1.0957 -1.1948 -1.2847 -1.3300  <BR>
348     -0.0749 -0.5936 -0.9285 -1.0508 -1.0971 -1.1667 -1.2290 -1.2591  <BR>
349     -0.1642 -0.7623 -0.9572 -1.0363 -1.0686 -1.1138 -1.1553 -1.1749  <BR>
350     -0.6122 -0.8322 -0.9440 -0.9937 -1.0141 -1.0433 -1.0685 -1.1000  <BR>
351     -0.6969 -0.8311 -0.8946 -0.9260 -0.9387 -0.9574 -0.9900 -0.9900  <BR>
352     -0.7189 -0.7851 -0.8240 -0.8442 -0.8504 -0.8800 -0.8800 -0.8800  <BR>
353     -0.6760 -0.7150 -0.7390 -0.7483 -0.7700 -0.7700 -0.7700 -0.7700  <BR>
354     -0.6048 -0.6299 -0.6600 -0.6600 -0.6600 -0.6600 -0.6600 -0.6600  <BR>
355     -0.5180 -0.5500 -0.5500 -0.5500 -0.5500 -0.5500 -0.5500 -0.5500  <BR>
356     -0.4186 -0.4400 -0.4400 -0.4400 -0.4400 -0.4400 -0.4400 -0.4400  <BR>
357     -0.3300 -0.3300 -0.3300 -0.3300 -0.3300 -0.3300 -0.3300 -0.3300  <BR>
358     -0.2200 -0.2200 -0.2200 -0.2200 -0.2200 -0.2200 -0.2200 -0.2200  <BR>
359     -0.1100 -0.1100 -0.1100 -0.1100 -0.1100 -0.1100 -0.1100 -0.1100  <BR>
"""

cd = CoefficientTable(cd_string)
cl = CoefficientTable(cl_string)

if __name__ == '__main__':
	pass
